#ifndef __SCNS_SMCTP_H__
#define __SCNS_SMCTP_H__

#include "ScnsConfig.h"

#if defined(SCNS_SMCTP_ENABLE)&&SCNS_SMCTP_ENABLE==1

#include "ScnsYing.h"
#include "ScnsBspSmctp.h"

typedef struct
{
    const uint8*buf;
    uint32 len;
}ScnsSmctpChars;

extern ScnsStatus scnsSmctpInit(void);

extern ScnsStatus scnsSmctpPutChar(ScnsSmctpChannelEnum ch,char c,uint32 block);
extern ScnsStatus scnsSmctpPutChars(ScnsSmctpChannelEnum ch,const uint8*buf,uint32 len,void (*callback)(ScnsSmctpChannelEnum ch),uint32 block);
extern ScnsStatus scnsSmctpPutCharsList(ScnsSmctpChannelEnum ch,const ScnsSmctpChars*list,uint8 listLen,void (*callback)(ScnsSmctpChannelEnum ch),uint32 block);
extern ScnsStatus scnsSmctpPutCharUnsafe(ScnsSmctpChannelEnum ch,char c,uint32 block);
extern ScnsStatus scnsSmctpPutCharsUnsafe(ScnsSmctpChannelEnum ch,const uint8*buf,uint32 len,void (*callback)(ScnsSmctpChannelEnum ch),uint32 block);
extern ScnsStatus scnsSmctpPutCharsListUnsafe(ScnsSmctpChannelEnum ch,const ScnsSmctpChars*list,uint8 listLen,void (*callback)(ScnsSmctpChannelEnum ch),uint32 block);

extern ScnsStatus scnsSmctpLockChannel(ScnsSmctpChannelEnum ch);
extern void scnsSmctpUnLockChannel(ScnsSmctpChannelEnum ch);

extern void scnsSmctpReceive(const uint8 buf[],int32 length,uint8 type);
extern ScnsStatus scnsSmctpFlushBuf(void);
extern uint64 scnsSmctpGetFlushUs(void);
extern uint64 scnsSmctpGetFlushTick(void);
extern void scnsSmctpSendFinishCallback(void);
#endif

#endif
